package leetcode.editor.week.week303;

import java.util.HashSet;

public class Solution6124 {
    public char repeatedCharacter(String s) {
        HashSet<Character> set = new HashSet<>();
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (set.contains(c)) {
                return c;
            }
            set.add(c);
        }
        return 0;
    }
}
